<?php
    if ($_SERVER['REQUEST_METHOD'] == 'GET')
    {
        include_once('ns_include.php');
        
        ns_dao_software::IncreaseDownloadCount($_GET['softwareID']);
        ns_dao_software::AddToUserSoftware($_GET['user'], $_GET['softwareID']);
        
        $fullPath = '../../content/software/'.$_GET['softwareID'].'/'.$_GET['softwareVersionID'].'/'.$_GET['filename'];

        header("Location: {$fullPath}");
        
        //echo '<a href="../../content/software/'.$_POST['softwareID'].'/'.$_POST['softwareVersionID'].'/'.$_POST['filename'].'">'.$_POST['filename'].'</a>';
    }
?>
